<?php
     class  ApiCenter_VendorsApi_Model_Api2_Account_Rest extends ApiCenter_VendorsApi_Model_Api2_Account{
        
         /**
          * Retrieve collection instance for single order
          *
          * @param int $orderId Order identifier
          * @return Mage_Sales_Model_Resource_Order_Collection
          */
         protected function _authenticate($vendor,$data)
         {
             /*Check if login is email*/
             $username=$data['username'];
             $password=$data['password'];
      
             $validator = new Zend_Validate_EmailAddress();
             if($validator->isValid($username)) {
                 $vendor->loadByEmail($username,$vendor->getWebsiteId());
             }else{
                 $vendor->loadByVendorId($username,$vendor->getWebsiteId());
             }
             if (!$vendor->validatePassword($password)) {
                 $this->_critical('Invalid login or password.');
             }
              
             if ($vendor->getConfirmation() && $vendor->isConfirmationRequired()) {
             
                 $this->_critical('Your vendor account is not confirmed.');
             }
              
             if ($vendor->getStatus() ==$vendor::STATUS_PENDING){
                 $this->_critical('Your vendor account is awaiting for approval.');
             }
              
             if ($vendor->getStatus() == $vendor::STATUS_DISABLED) {
                  
                 $this->_critical('Your vendor account has been suppended');
             
             }
         }
          
     }